package ar.uade.edu.fain.ad.server.business;

import java.util.List;

import ar.uade.edu.fain.ad.common.transfer.EmpleadoVO;
import ar.uade.edu.fain.ad.common.transfer.LoginVO;

public abstract class Empleado {

	private Long id;
	private String nombre;
	private String apellido;
	private String login;
	private String password;
	private List<IngresoUsuario> ingresos;
	private Area area;

	public Empleado() {
		super();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getNombre() {
		return nombre;
	}

	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

	public String getApellido() {
		return apellido;
	}

	public void setApellido(String apellido) {
		this.apellido = apellido;
	}

	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	public void setIngresos(List<IngresoUsuario> ingresos) {
		this.ingresos = ingresos;
	}

	public List<IngresoUsuario> getIngresos() {
		return ingresos;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Empleado other = (Empleado) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	public EmpleadoVO toVO() {
		final EmpleadoVO empleadoVO = new EmpleadoVO();
		empleadoVO.setId(getId());
		empleadoVO.setNombre(getNombre());
		empleadoVO.setApellido(getApellido());
		empleadoVO.setIdUsuario(getLogin());
		empleadoVO.setPassword(getPassword());
		return empleadoVO;
	}

	public abstract LoginVO createLoginVO();

}
